var i;

for (i=0;i<ds_grid_height(global.users);i++)
{

if (ds_grid_get(global.users,0,i)!=-1)
{

if (ds_grid_get(global.users,0,i).lgn==argument0) {return i; exit;}
}
}
for (i=0;i<ds_grid_height(global.users);i++)
{

if (ds_grid_get(global.users,0,i)==-1) {return i; exit;}
}
return i;
